Error: "Invalid object name"
Issue:
Your computed or subquery column returned an error stating that your code contains an "invalid object name".
Cause:
The table being referenced does not exist, or is misspelled.
Example:
SELECT [id]
FROM dbo.[contacts]
-- ERROR --
-- Invalid object name 'dbo.contacts'
Solution:
When referencing Rapid tables using SQL, we must use the singular name of the table. To correct this, we simply need to use:
SELECT [id]
FROM dbo.[contact]
You can check the database name of your tables by:
- Going to Designer
- Clicking Tables > All Tables in the sidebar
- Find the table's SQL name in the Table column
Note that built-in tables may be hidden from this list (e.g. the Principal table).
You can reveal these by choosing the "Show Built-in Tables" checkbox at the top of the page.
If a table's database name is too long, it may not display fully in the list. Open the table, and you can find its database name under the Naming Conventions header.